package com.yitiao.data_algorithms.leetcode.editor.cn;
import com.yitiao.data_algorithms.leetcode.editor.cn.base.ListNode;
import com.yitiao.data_algorithms.leetcode.editor.cn.base.TreeNode;

class RunningSumOf1dArray{
    // 2022-08-25 11:42:29
    public static void main(String[] args) {
        Solution solution = new RunningSumOf1dArray().new Solution();
    }
    
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public int[] runningSum(int[] nums) {
        int[] ans = new int[nums.length];
        ans [0] = nums[0];
        for (int i = 1; i < ans.length; i++) {
            ans[i] = ans[i-1]+nums[i];
        }
        return ans;
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}